---
title: clsTask
summary: API reference for clsTask.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks
reference_type: embedded
---

# clsTask

`clsTask` is the abstract base for every task business object in the SAIF BOF architecture. It owns the full persistence lifecycle against the `pk82036_task` Oracle stored-procedure package (insert/update/delete/select), common properties (category, priority, source, MailID, date, text, context), rule wiring for the shared task business rules, and snapshot/restore state for the framework's edit/cancel lifecycle. Concrete subclasses (in `SAIF.Business.Tasks.Claim`) supply source-system-specific behavior such as `ActionCode`, `SourceCode`, `SourceSystem`, `Load`, `PostFill`, `CopyTo`, `MarkCompleted`, and `NewTask`.

## Purpose
- Provide the shared persistence contract for a single task row, routing create/update/delete through `pk82036_task` and retrieval through `pk82036_task.task_select` ([SQL-001](../../sql/SQL-001-insert-task.md), [SQL-002](../../sql/SQL-002-select-task.md), [SQL-013](../../sql/SQL-013-update-task.md), [SQL-014](../../sql/SQL-014-delete-task.md)).
- Enforce the common task validation rules (required category/source/priority/MailID, valid source/category combination, current-or-future date) ([BR-001](../../business-rules.md#br-001-a-task-must-have-a-task-category-code)–[BR-008](../../business-rules.md#br-008-automatic-due-date-shifting-must-be-surfaced-as-a-warning)).
- Normalize task due dates to a working day via `AssignTaskDate` ([BR-009](../../business-rules.md#br-009-a-non-working-day-due-date-is-moved-to-a-working-day)).
- Provide an extensibility point (`OverrideRules`) so descendants can relax or approve a failing common rule ([BR-026](../../business-rules.md#br-026-descendant-task-types-may-override-common-rule-outcomes)).

## Context
- Namespace: `SAIF.Business.Tasks`
- Assembly/package: `SAIF.Business.Tasks` (embedded in the `LegalMaintenance` web deployment)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `CategoryCode` | `Property CategoryCode As String` | Task category code; must be set for a task to save ([BR-001](../../business-rules.md#br-001-a-task-must-have-a-task-category-code)). |
| `ClaimID` | `Property ClaimID As clsSmartDecimal` | Optional claim this task is attached to; nullable via `SetClaimIDNull`. |
| `ImageSeqNum` | `Property ImageSeqNum As clsSmartDecimal` | Optional imaging document sequence number associated with the task. |
| `MailID` | `Property MailID As String` | Assigned user; setter trims/upper-cases and fires the required-MailID rule ([BR-004](../../business-rules.md#br-004-a-task-must-be-assigned-to-a-mailid), [BR-016](../../business-rules.md#br-016-mailids-are-stored-and-compared-trimmed-and-upper-cased)). |
| `PolicyNumber` | `Property PolicyNumber As clsSmartDecimal` | Optional policy this task is attached to; nullable via `SetPolicyNumberNull`. |
| `PriorityCode` | `Property PriorityCode As String` | Task priority code; must be set for a task to save ([BR-003](../../business-rules.md#br-003-a-task-must-have-a-priority-code)). |
| `TaskDate` | `Property TaskDate As clsSmartDate` | Task due date; setter routes through `AssignTaskDate`, normalizing non-working days ([BR-009](../../business-rules.md#br-009-a-non-working-day-due-date-is-moved-to-a-working-day)). |
| `TaskSecurity` | `Property TaskSecurity As String` | Security classification string; persisted but never evaluated in this library**. |
| `Text` | `Property Text As String` | Task narrative text; `Nothing` is coerced to `String.Empty` ([BR-027](../../business-rules.md#br-027-task-text-is-never-null)). |
| `CreateDate` | `ReadOnly Property CreateDate As clsSmartDate` | Date the task row was created. |
| `CreateUser` | `ReadOnly Property CreateUser As String` | User who created the task; defaults to the DPI user identity when unset ([BR-014](../../business-rules.md#br-014-creating-user-defaults-to-the-data-portal-user-identity)). |
| `UpdateDate` | `ReadOnly Property UpdateDate As clsSmartDate` | Date of the last successful update. |
| `UpdateUser` | `ReadOnly Property UpdateUser As String` | User who performed the last update. |
| `TaskSeqNum` | `ReadOnly Property TaskSeqNum As clsSmartDecimal` | Primary key of the task row; the optimistic-concurrency token pair with `UpdateSeqNum` protects updates/deletes ([BR-013](../../business-rules.md#br-013-optimistic-concurrency-via-update-sequence-number)). |
| `IsMailIDModified` | `ReadOnly Property IsMailIDModified As Boolean` | Whether `MailID` has changed since load. |
| `IsTaskDateModified` | `ReadOnly Property IsTaskDateModified As Boolean` | Whether `TaskDate` has changed since load. |
| `TaskDateModified` | `ReadOnly Property TaskDateModified As Boolean` | Set when `AssignTaskDate` auto-shifted the date to a working day; drives the [BR-008](../../business-rules.md#br-008-automatic-due-date-shifting-must-be-surfaced-as-a-warning) warning. |
| `MyCriteria` | `ReadOnly Property MyCriteria As CriteriaBase` | The nested `IBusinessCriteria` instance carrying the stored-procedure names and DPI for this task. |
| `ActionCode` | `MustOverride ReadOnly Property ActionCode As String` | Abstract — descendant supplies the task's action code. |
| `DisplayField1`, `DisplayField2`, `DisplayField3` | `MustOverride ReadOnly Property DisplayFieldN As String` | Abstract — descendant supplies source-system-specific display text. |
| `RequiresNotePadEntry` | `MustOverride ReadOnly Property RequiresNotePadEntry As Boolean` | Abstract — descendant determines whether a notepad entry is mandatory. |
| `SourceCode` | `MustOverride ReadOnly Property SourceCode As String` | Abstract — descendant supplies the task's source category code. |
| `SourceSystem` | `MustOverride ReadOnly Property SourceSystem As TaskSourceSystem` | Abstract — descendant supplies its `TaskSourceSystem` enum value. |
| `Load` | `MustOverride Sub Load(dpi As IDataPortalInfo, reader As IDataReader)` | Abstract — descendant maps its own additional columns after the base `Fill`. |
| `PostFill` | `MustOverride Sub PostFill()` | Abstract — hook called at the end of `Fill` for descendant-specific mapping. |
| `CopyTo` | `MustOverride Function CopyTo(inMailID As String) As iTask` | Abstract — descendant creates a new instance and calls `CopyTask` to populate it (see [Copy a task to another user](../../operations/copy-task-to-another-user.md)). |
| `MarkCompleted` | `MustOverride Sub MarkCompleted()` | Abstract — descendant-specific completion behavior. |
| `Append` | `Sub Append(inText As String)` | Appends text to the task's narrative. |
| `Pend` | `Sub Pend(inTimeSpan As TimeSpan)` | Defers the task by the given time span*. |
| `Equals` | `Function Equals(obj As Object) As Boolean` | Value-equality comparison, likely keyed on `TaskSeqNum`*. |
| `GetHashCode` | `Function GetHashCode() As Integer` | Hash code consistent with `Equals`*. |
| `ToString` | `Function ToString() As String` | Formats as `dd-MMM-yyyy` + hyphen + task text. |
| `SetClaimIDNull`, `SetImageSeqNumNull`, `SetPolicyNumberNull` | `Sub Set*Null()` | Explicitly nulls the corresponding optional smart value. |
| `IsClaimIDNull`, `IsImageSeqNumNull`, `IsPolicyNumberNull`, `IsUpdateDateNull`, `IsUpdateUserNull` | `Function Is*Null() As Boolean` | Reports whether the corresponding value is currently null/empty. |
| `BatchRules` | `Protected Property BatchRules As Boolean` | When true, bypasses the current/future date rule ([BR-007](../../business-rules.md#br-007-batch-created-tasks-bypass-the-currentfuture-date-rule)). |
| `DeleteFlag` | `Protected Property DeleteFlag As String` | Underlying soft-delete/completion flag column value. |
| `NotepadFlag` | `Protected Property NotepadFlag As String` | Underlying notepad-entry flag column value. |
| `TaskContext` | `Protected Property TaskContext As clsTaskContext` | The six-column context value holder for this task. |
| `TaskDateModifier` | `Protected Property TaskDateModifier As TaskDateModifierType` | Controls which direction `AssignTaskDate` shifts a non-working-day date. |
| `UpdateSeqNum` | `Protected Property UpdateSeqNum As clsSmartDecimal` | The optimistic-concurrency token value ([BR-013](../../business-rules.md#br-013-optimistic-concurrency-via-update-sequence-number)). |
| `CopyTask` | `Protected Sub CopyTask(inTask As clsTask)` | Copies core fields and duplicates context onto a target instance (see [Copy a task to another user](../../operations/copy-task-to-another-user.md)). |
| `StoreValues` | `Protected Sub StoreValues()` | Snapshots 25 keyed field values into a `TaskStore` (see [Snapshot/restore task state](../../operations/snapshot-restore-task-state.md)). |
| `RestoreValues` | `Protected Sub RestoreValues()` | Restores field values from the `TaskStore` snapshot; the context-text key mismatch means restored context text is always empty*. |
| `OverrideRules` | `Protected Overridable Function OverrideRules(inRuleName As String, ...) As Boolean` | No-op hook by default; descendants can convert a failing common rule into a pass ([BR-026](../../business-rules.md#br-026-descendant-task-types-may-override-common-rule-outcomes)). |
| `TaskDateModifierType` | `Public Enum TaskDateModifierType` | Nested enum controlling automatic due-date adjustment: `CurrentDay`, `PriorWorkDay`, `NextWorkDay`. |
| `CriteriaBase` | `Public Class CriteriaBase` (nested, implements `IBusinessCriteria`) | Holds the `pk82036_task` stored-procedure names and DPI for `clsTask` persistence. |
| `TaskStore` | `Private Class TaskStore` (nested, `<Serializable>`) | Hashtable-backed snapshot store used by `StoreValues`/`RestoreValues`. |

## Behavioral notes
- Every public property is decorated with `<Reportable()>`, exposing it to the framework reporting/binding surface*.
- The class is `<Serializable()>`, consistent with remoting/session persistence of BOF objects across the web tier*.
- `MyCriteria.WhereClause`-equivalent logic is not present on `clsTask` itself; see `clsTaskCollection.Criteria` for the analogous (and effectively dead) property.

## Constraints and usage notes
- `clsTask` is `MustInherit` — this library never instantiates a concrete task type directly; concrete task types live in `SAIF.Business.Tasks.Claim`.
- Business objects never open database connections directly; all persistence flows through the caller-supplied `IDataPortalInfo`.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [API index](../index.md)
- [Operations and processes](../../operations-processes.md)
- [Business rules](../../business-rules.md)
- [Database tables](../../database-tables.md)

## Sources
- SAIF.Business.Tasks/clsTask.vb
